/*******************************************************************************
  * @file                   main.c
  * @Author:                MQjehovah                 mail:MQjehovah@hotmail.com
  * @version                1.0.0
  * @date                   2017.8.24
  * @brief                  
  ******************************************************************************
  * @attention
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stdio.h"
#include "stepper.h"
#include "shell.h"
/* Definition ----------------------------------------------------------------*/

/* Functions -----------------------------------------------------------------*/
/*******************************************************************************
  * @brief  主函数              
  * @param  None              
  * @retval None              
  * @Note   None              
*******************************************************************************/
int main(void)
{
	int freq = 5000;//150可以直接启动，100需要一个启动过程
    SysTick_init();
    E34_Init();
    //stepper_tim_init(50, 84);
	Motor_PWM_Init();
    //stepper_pwm_init(freq, 84);
	//TIM_SetCompare2(TIM2,freq>>1);
    stepper_set_enable(0);
    stepper_set_dir(0);
	pmotor->en = 1;
	pmotor->step_time = 0;
	pmotor->state = acc;
	pmotor->step = 2000;
	TIM_Cmd(TIM2, ENABLE); //使能TIM2
    while (1)
    {
        shell_loop();
    }
}

/*********************************END OF FILE**********************************/
